﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <iframe src="XDMinnerFrame.html" style="width:100% ; height:300px" id="innerFrame"></iframe>
    <div>
        <span>消息内容:</span><input  type="text" id="message"/>
        <input type="button" value="向内嵌框架中发送消息" onclick="testXDM()" />
    </div>

    <script>
        function testXDM() {
            var innerFrame = window.document.getElementById("innerFrame").contentWindow;
            innerFrame.postMessage(document.getElementById("message").value,"*");
        }
    </script>
</body>
</html>
